import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";
import Home from "@/views/home/index";

// 首页模块
const homeRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		title: "首页",
		key: "homeFolder",
		skipAuth: true,
		children: [
			{
				path: "/home/index",
				// element: lazyLoad(React.lazy(() => import("@/views/home/index"))),
				element: <Home />,
				title: "首页",
				skipAuth: true,
				key: "home",
			},
		],
	},
	{
		element: <LayoutIndex />,
		key: "dashboard",
		title: "Dashboard",
		icon: "FundOutlined",
		path: "/dashboard",
		children: [
			{
				path: "/dashboard/dataVisualize",
				element: lazyLoad(React.lazy(() => import("@/views/dashboard/dataVisualize/index"))),

				title: "数据可视化",
				key: "dataVisualize",
			},
			{
				path: "/dashboard/embedded",
				element: lazyLoad(React.lazy(() => import("@/views/dashboard/embedded/index"))),

				title: "内嵌页面",
				key: "embedded",
				children: [
					{
						path: "/dashboard/embedded/m31",
						element: lazyLoad(React.lazy(() => import("@/views/dashboard/dataVisualize/index"))),
						title: "菜单1",
						key: "m31",
					},
					{
						path: "/dashboard/embedded/m32",
						element: lazyLoad(React.lazy(() => import("@/views/dashboard/embedded/index"))),
						title: "菜单2",
						key: "m32",
					},
				],
			},
		],
	},
	{
		element: <LayoutIndex />,
		key: "form",
		title: "表单 Form",
		icon: "FileTextOutlined",
		path: "/form",
		children: [
			{
				path: "/form/basicForm",
				element: lazyLoad(React.lazy(() => import("@/views/form/basicForm/index"))),

				title: "基础 Form",
				key: "basicForm",
			},
			{
				path: "/form/validateForm",
				element: lazyLoad(React.lazy(() => import("@/views/form/validateForm/index"))),

				title: "校验 Form",
				key: "validateForm",
			},
			{
				path: "/form/dynamicForm",
				element: lazyLoad(React.lazy(() => import("@/views/form/dynamicForm/index"))),

				title: "动态 Form",
				key: "dynamicForm",
			},
		],
	},
	{
		element: <LayoutIndex />,
		key: "common",
		title: "常用组件",
		icon: "ShoppingOutlined",
		path: "/assembly",
		children: [
			{
				path: "/assembly/guide",
				element: lazyLoad(React.lazy(() => import("@/views/assembly/guide/index"))),
				title: "引导页",
				key: "guide",
			},
			{
				path: "/assembly/svgIcon",
				element: lazyLoad(React.lazy(() => import("@/views/assembly/svgIcon/index"))),
				title: "SVG 图标",
				key: "svgIcon",
			},
			{
				path: "/assembly/selectIcon",
				element: lazyLoad(React.lazy(() => import("@/views/assembly/selectIcon/index"))),
				title: "Icon 选择",
				key: "selectIcon",
			},
			{
				path: "/assembly/batchImport",
				element: lazyLoad(React.lazy(() => import("@/views/assembly/batchImport/index"))),
				title: "批量导入数据",
				key: "batchImport",
			},
		],
	},
	{
		element: <LayoutIndex />,
		key: "outlink",
		title: "外部链接",
		icon: "PaperClipOutlined",
		path: "/link",
		children: [
			{
				path: "/link/gitee",
				element: lazyLoad(React.lazy(() => import("@/views/link/gitee/index"))),

				title: "Gitee 仓库",
				key: "gitee",
			},
			{
				path: "/link/gitcode",
				element: lazyLoad(React.lazy(() => import("@/views/link/gitcode/index"))),

				title: "GitCode 仓库",
				key: "gitcode",
			},
			{
				path: "/link/juejin",
				element: lazyLoad(React.lazy(() => import("@/views/link/juejin/index"))),

				title: "掘金文档",
				key: "juejin",
			},
			{
				path: "/link/myBlog",
				element: lazyLoad(React.lazy(() => import("@/views/link/myBlog/index"))),

				title: "个人博客",
				key: "myBlog",
			},
		],
	},
	{
		element: <LayoutIndex />,
		key: "system",
		title: "系统管理",
		icon: "SettingOutlined",
		path: "/system",
		children: [
			{
				path: "/system/user",
				element: lazyLoad(React.lazy(() => import("@/views/system/user/index"))),
				title: "用户管理",
				key: "user",
			},
			{
				path: "/system/role",
				element: lazyLoad(React.lazy(() => import("@/views/system/role/index"))),
				title: "角色管理",
				key: "role",
			},
		],
	},
];

export default homeRouter;
